package com.hello_android;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class Summation extends Activity {

	public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_summation);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_summation, menu);
        return true;
    }
    
    public void sendMessage(View view) 
    {
    	Intent intent = new Intent(this, DisplayMessageActivity.class);
    	EditText VariableB = (EditText) findViewById(R.id.VariableB);
    	EditText VariableA = (EditText) findViewById(R.id.VariableA);
    	int sum = Integer.parseInt(VariableA.getText().toString()) + Integer.parseInt(VariableB.getText().toString()) ;
//    	String message = VariableA.getText().toString();
    	intent.putExtra(EXTRA_MESSAGE, Integer.toString(sum));
    	startActivity(intent);
    }
}
